import request from '@/utils/request'

// 查询物料产品列表
export function listGoods(query) {
  return request({
    url: '/zxbd/goods/list',
    method: 'get',
    params: query
  })
}

// 查询物料产品详细
export function getGoods(code) {
  return request({
    url: '/zxbd/goods/' + code,
    method: 'get'
  })
}

// 新增物料产品
export function addGoods(data) {
  return request({
    url: '/zxbd/goods',
    method: 'post',
    data: data
  })
}

// 修改物料产品
export function updateGoods(data) {
  return request({
    url: '/zxbd/goods',
    method: 'put',
    data: data
  })
}

// 删除物料产品
export function delGoods(code) {
  return request({
    url: '/zxbd/goods/' + code,
    method: 'delete'
  })
}


// 查询物料产品详细
export function getGoodsType() {
  return request({
    url: '/zxbd/category/TreeList',
    method: 'get'
  })
}




export function getGoodsLineList(query) {
  return request({
    url: '/zxbd/goodsLine/list',
    method: 'get',
    params: query
  })
}


export function getGoodsLine(code) {
  return request({
    url: '/zxbd/goodsLine/'+code,
    method: 'get'
  })
}
export function getGoodsValue() {
  return request({
    url: '/zxbd/goodsLine/value',
    method: 'get'
  })
}

export function UpdateGoodsLine(data) {
  return request({
    url: '/zxbd/goodsLine',
    method: 'put',
    data: data
  })
}
export function InsertGoodsLine(data) {
  return request({
    url: '/zxbd/goodsLine',
    method: 'post',
    data: data
  })
}
// 删除物料产品
export function delGoodsLine(code) {
  return request({
    url: '/zxbd/goodsLine/' + code,
    method: 'delete'
  })
}
